package com.freshmarket.freshmarket.dao;

import com.freshmarket.freshmarket.controller.form.CouponShowForm;
import com.freshmarket.freshmarket.entity.Coupon;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Squirrel
 * @since 2020-09-04
 */
public interface CouponMapper extends BaseMapper<Coupon> {

    //查询现金抵扣的优惠券
    public List<Coupon> selectCash(@Param("couponDiscountsStatus")String couponDiscountsStatus,
                                         @Param("couponStatusOne")String couponStatusOne,
                                         @Param("couponStatusTwo")String couponStatusTwo);
    //通过id查询优惠券的到期时间
    public Coupon selectByCouponId(@Param("couponId") Integer couponId)throws Exception;

    //查询积分兑换的优惠券
    public List<Coupon> selectScore(@Param("couponDiscountsStatus")String couponDiscountsStatus,
                                   @Param("couponStatusThree")String couponStatusThree);
    //查询折扣券
    public List<Coupon> selectDiscount(@Param("couponDiscountsStatus")String couponDiscountsStatus);




    public List<Coupon> selectByCouponStatus(String couponStatus);



    //直接发放的券（查询券的状态）
    //public List<CouponShowForm> selectByCouponStatusOne(String couponStatus);


    //个人优惠券
    public List<Coupon> selectByIdCoupon(@Param("userId") Integer userId,
                                         @Param("couponStatus") String couponStatus)throws Exception;

}
